/**
 * 
 */
package fhq.hcmute.qrcode.common;

/**
 * @author Hien Nguyen Le
 * @Email: nglehien@gmail.com
 */
public enum ErrorCorrectionLevel {
	/**
	 * @Data: 01
	 * @L : approx 7% correction
	 * */
	L("01"),
	/**
	 * @Data: 00
	 * @M : approx 15% correction
	 */
	M("00"),
	/**
	 * @Data: 11
	 * @Q : approx 25% correction
	 */
	Q("11"),
	/**
	 * @Data: 10
	 * @H : approx 30% correction
	 */
	H("10");

	private String value;

	private ErrorCorrectionLevel(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public static ErrorCorrectionLevel parse(String mask) {
		for (ErrorCorrectionLevel b : ErrorCorrectionLevel.values()) {
			if (b.value.equals(mask)) {
				return b;
			}
		}
		return ErrorCorrectionLevel.Q;
	}
}
